package global

import "server/exception"

/*
Date:2021/11/20
Time:11:35 下午
*/

func NewMessageError(msg string) (err exception.Error) {
	err = exception.SystemError
	err.Message = msg
	return
}

func NewCodeError(code int) (e exception.Error) {
	e = exception.SystemError
	if msg, ok := exception.CodeMapping[code]; ok {
		e.Code = code
		e.Message = msg
	}
	return
}
